Skip to content

Attempt to fix kotlin 2.2 issue #4603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Aug 4, 2025

📜 Description

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Aug 4, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Attempt to fix kotlin 2.2 issue ([#4603](https://github.com/getsentry/sentry-java/pull/4603))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 1ae8108

@adinauer adinauer force-pushed the 08-04-fix_spring_7_and_spring_boot_4_modules branch from c7988b5 to a5d68ca Compare August 6, 2025 14:34
@adinauer adinauer force-pushed the 08-04-attempt_to_fix_kotlin_2.2_issue branch from 91df7de to c97638e Compare August 6, 2025 14:34
@adinauer adinauer mentioned this pull request Aug 6, 2025
7 tasks
adinauer and others added 2 commits August 7, 2025 16:35
* Second attempt to fix Kotlin 2.2

* Format code

* Third attempt at fixing Kotlin 2.2 compat (#4613)

---------

Co-authored-by: Sentry Github Bot <[email protected]>
Base automatically changed from 08-04-fix_spring_7_and_spring_boot_4_modules to 08-04-add_new_modules_for_spring_7_and_spring_boot_4 August 8, 2025 10:02
Copy link
Contributor

github-actions bot commented Aug 8, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 413.35 ms 445.66 ms 32.31 ms
Size 1.58 MiB 2.09 MiB 524.25 KiB

Baseline results on branch: 08-04-add_new_modules_for_spring_7_and_spring_boot_4

Startup times

Revision Plain With Sentry Diff
0fef848 426.67 ms 455.08 ms 28.41 ms
e7c4664 416.04 ms 441.27 ms 25.22 ms
b2c2d0b 414.00 ms 447.42 ms 33.42 ms

App size

Revision Plain With Sentry Diff
0fef848 1.58 MiB 2.09 MiB 522.33 KiB
e7c4664 1.58 MiB 2.09 MiB 521.83 KiB
b2c2d0b 1.58 MiB 2.09 MiB 521.57 KiB

Previous results on branch: 08-04-attempt_to_fix_kotlin_2.2_issue

Startup times

Revision Plain With Sentry Diff
1e0ee95 509.08 ms 530.81 ms 21.73 ms

App size

Revision Plain With Sentry Diff
1e0ee95 1.58 MiB 2.09 MiB 524.25 KiB

* Second attempt to fix Kotlin 2.2

* Format code

* Third attempt at fixing Kotlin 2.2 compat

* Fix tests for Spring 7 and Spring Boot 4

* Move Spring 7 and Spring Boot 4 packages (#4615)

* Move Spring 7 and Spring Boot 4 packages

* Fix class not found due to OTel not supporting spring boot 4 yet (#4616)

* Format code

* some fixes

* change kotlin 1.8 to 1.9 and some cleanup

* ignore warnings about api level that is not relevant

* fix optional dependencies in SentryAutoConfiguration

* Update trace origin

* Remove duplicate e2e test config

* Update Strings for Spring 7 and Spring Boot 4

* Disable Spring Boot 4 agentless e2e tests for now

---------

Co-authored-by: Sentry Github Bot <[email protected]>
@adinauer adinauer marked this pull request as ready for review August 11, 2025 12:12
@adinauer adinauer merged commit 59cb440 into 08-04-add_new_modules_for_spring_7_and_spring_boot_4 Aug 11, 2025
30 of 33 checks passed
@adinauer adinauer deleted the 08-04-attempt_to_fix_kotlin_2.2_issue branch August 11, 2025 12:12
@Bean
public SentrySpanWebClientCustomizer sentrySpanWebClientCustomizer(IScopes scopes) {
return new SentrySpanWebClientCustomizer(scopes);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Sentry Customizers Fail Due to Incorrect Class Checks

Auto-configuration wrappers for RestTemplate, RestClient, and WebClient incorrectly use @ConditionalOnClass to require their respective *AutoConfiguration classes. This prevents Sentry customizers from registering if the auto-configuration class is missing or relocated, even when the client is present. This silently disables span instrumentation for these clients in Spring Boot 4. The wrapper's @ConditionalOnClass should only check for the client, relying on the inner configuration's @AutoConfigureBefore for ordering.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants